package com.aspose.cells.b.a;

import java.text.NumberFormat;
import java.text.ParseException;

public class zo {
   public static int a(String var0) {
      int var1 = var0.indexOf(".");
      if (var1 == -1) {
         return Integer.parseInt(var0);
      } else {
         double var2 = Double.parseDouble(var0);
         if ((double)((long)var2) == var2) {
            return (int)var2;
         } else {
            throw new NumberFormatException("Failed to parse int:" + var0);
         }
      }
   }

   public static int a(String var0, int var1) {
      boolean var2 = true;
      byte var3;
      if (var1 != 7 && var1 != 111) {
         if (var1 != 515 && var1 != 512) {
            throw new IllegalArgumentException("NumberStyle {}" + Integer.toString(var1) + " not supported");
         }

         var3 = 16;
      } else {
         var3 = 10;
      }

      return (int)Long.parseLong(var0.trim(), var3);
   }

   public static int a(String var0, int var1, com.aspose.cells.b.a.c.za var2) {
      return a(var0, var1);
   }

   public static int a(String var0, com.aspose.cells.b.a.c.za var1) {
      try {
         if (var1.c()) {
            return Integer.parseInt(var0.trim());
         } else {
            NumberFormat var2 = NumberFormat.getInstance(var1.h());
            return ((Long)var2.parse(var0.trim())).intValue();
         }
      } catch (ParseException var3) {
         throw new NumberFormatException("Failed to parse string[]" + var0 + " into a number");
      }
   }

   public static String a(int var0) {
      return Integer.toString(var0);
   }

   public static int a(int var0, int var1) {
      if (var0 == var1) {
         return 0;
      } else {
         return var0 > var1 ? 1 : -1;
      }
   }
}
